package com.xdl.backstage.base.bean;

import java.util.Date;

import com.xdl.backstage.base.domain.Company;
import com.xdl.backstage.base.domain.UserManager;
import com.xdl.backstage.base.entity.CompanyEntity;
import com.xdl.backstage.base.entity.UserManagerEntity;
import com.xdl.moudle.utils.util.EnumUtil.OpearteMode;

public class UserManagerBean {

	private OpearteMode opearteMode = OpearteMode.NORMAL;

	private String id;

	private String code;

	private String name;

	private String sex;

	private Date birthday;

	private String phone;

	private String pwd;

	private Boolean isDelete;

	private Boolean isOpen;

	private String eMail;

	private Date createTime;

	private String createUser;

	private Date updateTime;

	private String updateUser;

	private String companyStatus;

	private String companyName;

	private String companyId;

	public UserManagerBean() {

	}

	public UserManagerBean(UserManagerEntity entity) {
		if (entity != null) {
			this.setId(entity.getId());
			this.setCode(entity.getCode());
			this.setName(entity.getName());
			this.setSex(entity.getSex());
			this.setBirthday(entity.getBirthday());
			this.setPhone(entity.getPhone());
			this.setPwd(entity.getPwd());
			this.setIsDelete(entity.getIsDelete());
			this.setIsOpen(entity.getIsOpen());
			this.seteMail(entity.geteMail());
			this.setCreateTime(entity.getCreateTime());
			this.setCreateUser(entity.getCreateUser());
			this.setUpdateTime(entity.getUpdateTime());
			this.setUpdateUser(entity.getUpdateUser());
			this.setCompanyStatus(entity.getCompanyStatus());
			CompanyEntity company = entity.getCompany();
			if (company != null ) {
				this.setCompanyId(company.getId());
			}
		}
	}

	public UserManager beanToData() {
		UserManager data = new UserManager();
		data.setId(this.getId());
		data.setCode(this.getCode());
		data.setName(this.getName());
		data.setSex(this.getSex());
		data.setBirthday(this.getBirthday());
		data.setPhone(this.getPhone());
		data.setPwd(this.getPwd());
		data.setIsDelete(this.getIsDelete());
		data.setIsOpen(this.getIsOpen());
		data.seteMail(this.geteMail());
		data.setCreateTime(this.getCreateTime());
		data.setCreateUser(this.getCreateUser());
		data.setUpdateTime(this.getUpdateTime());
		data.setUpdateUser(this.getUpdateUser());
		data.setCompanyStatus(this.getCompanyStatus());
		data.setCompanyId(this.getCompanyId());
		return data;
	}

	public OpearteMode getOpearteMode() {
		return opearteMode;
	}

	public void setOpearteMode(OpearteMode opearteMode) {
		this.opearteMode = opearteMode;
	}

	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	public String getCode() {
		return code;
	}

	public void setCode(String code) {
		this.code = code;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getSex() {
		return sex;
	}

	public void setSex(String sex) {
		this.sex = sex;
	}

	public Date getBirthday() {
		return birthday;
	}

	public void setBirthday(Date birthday) {
		this.birthday = birthday;
	}

	public String getPhone() {
		return phone;
	}

	public void setPhone(String phone) {
		this.phone = phone;
	}

	public String getPwd() {
		return pwd;
	}

	public void setPwd(String pwd) {
		this.pwd = pwd;
	}

	public Boolean getIsDelete() {
		return isDelete;
	}

	public void setIsDelete(Boolean isDelete) {
		this.isDelete = isDelete;
	}

	public Boolean getIsOpen() {
		return isOpen;
	}

	public void setIsOpen(Boolean isOpen) {
		this.isOpen = isOpen;
	}

	public String geteMail() {
		return eMail;
	}

	public void seteMail(String eMail) {
		this.eMail = eMail;
	}

	public Date getCreateTime() {
		return createTime;
	}

	public void setCreateTime(Date createTime) {
		this.createTime = createTime;
	}

	public String getCreateUser() {
		return createUser;
	}

	public void setCreateUser(String createUser) {
		this.createUser = createUser;
	}

	public Date getUpdateTime() {
		return updateTime;
	}

	public void setUpdateTime(Date updateTime) {
		this.updateTime = updateTime;
	}

	public String getUpdateUser() {
		return updateUser;
	}

	public void setUpdateUser(String updateUser) {
		this.updateUser = updateUser;
	}

	public String getCompanyStatus() {
		return companyStatus;
	}

	public void setCompanyStatus(String companyStatus) {
		this.companyStatus = companyStatus;
	}

	public String getCompanyName() {
		return companyName;
	}

	public void setCompanyName(String companyName) {
		this.companyName = companyName;
	}

	public String getCompanyId() {
		return companyId;
	}

	public void setCompanyId(String companyId) {
		this.companyId = companyId;
	}

}
